<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Windows系统下用hexo搭建个人博客 | Miki&#39;s blog</title>
  <meta name="keywords" content=" 博客搭建 ">
  <meta name="description" content="Windows系统下用hexo搭建个人博客 | Miki&#39;s blog">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description" content="keywords: author: Miki language: zh-CN timezone:">
<meta property="og:type" content="website">
<meta property="og:title" content="标签">
<meta property="og:url" content="http://mikiblog.online/tags/index.html">
<meta property="og:site_name" content="Miki&#39;s blog">
<meta property="og:description" content="keywords: author: Miki language: zh-CN timezone:">
<meta property="og:locale" content="en_US">
<meta property="article:published_time" content="2020-02-22T01:48:02.000Z">
<meta property="article:modified_time" content="2020-02-22T01:50:40.651Z">
<meta property="article:author" content="Miki Zhu">
<meta name="twitter:card" content="summary">


<link rel="icon" href="/img/1.jpg">

<link href="/css/style.css?v=1.0.1" rel="stylesheet">

<link href="/css/hl_theme/atom-dark.css?v=1.0.1" rel="stylesheet">

<link href="//cdn.bootcss.com/animate.css/3.5.2/animate.min.css" rel="stylesheet">
<link href="//cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">

<script src="//cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>
<script src="/js/jquery.autocomplete.min.js?v=1.0.1" ></script>

<script src="//cdn.bootcss.com/highlight.js/9.12.0/highlight.min.js"></script>
<script>
    hljs.initHighlightingOnLoad();
</script>

<script src="//cdn.bootcss.com/nprogress/0.2.0/nprogress.min.js"></script>



<script src="/js/iconfont.js?v=1.0.1" ></script>

<meta name="generator" content="Hexo 4.2.0"></head>
<div style="display: none">
  <input class="theme_disqus_on" value="false">
  <input class="theme_preload_comment" value="false">
  <input class="theme_blog_path" value="">
</div>

<body>
<aside class="nav">
    <div class="nav-left">
        <a href="/" class="avatar_target">
    <img class="avatar" src="/img/头像.jpg" />
</a>
<div class="author">
    <span>Miki Zhu</span>
</div>

<div class="icon">
    
        
    
        
        <a title="email" href="mailto:747876457@qq.com" target="_blank">
            
                <svg class="iconfont-svg" aria-hidden="true">
                    <use xlink:href="#icon-email"></use>
                </svg>
            
        </a>
        
    
        
        <a title="qq" href="http://wpa.qq.com/msgrd?v=3&uin=747876457&site=qq&menu=yes" target="_blank">
            
                <svg class="iconfont-svg" aria-hidden="true">
                    <use xlink:href="#icon-qq"></use>
                </svg>
            
        </a>
        
    
</div>




<ul>
    <li><div class="all active">全部文章<small>(29)</small></div></li>
    
        
            
            <li><div data-rel="机器学习">机器学习<small>(7)</small></div>
                
            </li>
            
        
    
        
            
            <li><div data-rel="机器学习实战">机器学习实战<small>(3)</small></div>
                
            </li>
            
        
    
        
            
            <li><div data-rel="项目实战">项目实战<small>(4)</small></div>
                
            </li>
            
        
    
        
            
            <li><div data-rel="博客搭建">博客搭建<small>(2)</small></div>
                
            </li>
            
        
    
        
            
            <li><div data-rel="算法">算法<small>(3)</small></div>
                
            </li>
            
        
    
        
            
            <li><div data-rel="python教程">python教程<small>(1)</small></div>
                
            </li>
            
        
    
        
            
            <li><div data-rel="学习网站推荐">学习网站推荐<small>(1)</small></div>
                
            </li>
            
        
    
        
            
            <li><div data-rel="考研经验">考研经验<small>(1)</small></div>
                
            </li>
            
        
    
</ul>
<div class="left-bottom">
    <div class="menus">
    
    
    
    
    </div>
    <div><a class="about  " target="_blank" href="/about">关于</a></div>
</div>
<input type="hidden" id="yelog_site_posts_number" value="29">
<input type="hidden" id="yelog_site_word_count" value="62.1k">
<div style="display: none">
    <span id="busuanzi_value_site_uv"></span>
    <span id="busuanzi_value_site_pv"></span>
</div>

    </div>
    <div class="nav-right">
        <div class="friends-area">
    <div class="friends-title">
        友情链接
        <i class="back-title-list"></i>
    </div>
    <div class="friends-content">
        <ul>
            
        </ul>
    </div>
</div>
        <div class="title-list">
    <form onkeydown="if(event.keyCode === 13){return false;}">
        <input id="local-search-input" class="search" type="text" placeholder="Search..." />
        <i class="cross"></i>
        <span>
            <label for="tagswitch">Tags:</label>
            <input id="tagswitch" type="checkbox" style="display: none" />
            <i id="tagsWitchIcon"></i>
        </span>
    </form>
    <div class="tags-list">
    
    <li class="article-tag-list-item">
        <a class="color5">机器学习</a>
    </li>
    
    <li class="article-tag-list-item">
        <a class="color3">算法</a>
    </li>
    
    <li class="article-tag-list-item">
        <a class="color5">博客搭建</a>
    </li>
    
    <li class="article-tag-list-item">
        <a class="color2">python</a>
    </li>
    
    <li class="article-tag-list-item">
        <a class="color5">网站推荐</a>
    </li>
    
    <li class="article-tag-list-item">
        <a class="color5">考研经验</a>
    </li>
    
    <div class="clearfix"></div>
</div>

    
    <nav id="title-list-nav">
        
        <a id="top" class="python教程 "
           href="/2020/04/03/python%E9%9D%A2%E8%AF%95%E9%A2%98/"
           data-tag="python"
           data-author="" >
            <span class="post-title" title="python面试题(不定期更新)">python面试题(不定期更新)</span>
            <span class="post-date" title="2020-04-03 21:14:43">2020/04/03</span>
        </a>
        
        <a id="top" class="考研经验 "
           href="/2020/02/20/%E8%80%83%E7%A0%94%E5%88%9D%E8%AF%95%E7%BB%8F%E9%AA%8C/"
           data-tag="考研经验"
           data-author="" >
            <span class="post-title" title="考研初试经验">考研初试经验</span>
            <span class="post-date" title="2020-02-20 19:33:48">2020/02/20</span>
        </a>
        
        <a  class="机器学习实战 "
           href="/2020/04/19/%E9%80%BB%E8%BE%91%E5%9B%9E%E5%BD%92%E4%BB%A3%E7%A0%81%E5%AE%9E%E7%8E%B0/"
           data-tag="机器学习"
           data-author="" >
            <span class="post-title" title="逻辑回归代码实现">逻辑回归代码实现</span>
            <span class="post-date" title="2020-04-19 21:09:25">2020/04/19</span>
        </a>
        
        <a  class="机器学习 "
           href="/2020/04/14/%E9%A9%AC%E5%B0%94%E5%8F%AF%E5%A4%AB%E9%93%BE/"
           data-tag="机器学习"
           data-author="" >
            <span class="post-title" title="马尔可夫链">马尔可夫链</span>
            <span class="post-date" title="2020-04-14 19:09:29">2020/04/14</span>
        </a>
        
        <a  class="机器学习实战 "
           href="/2020/04/14/%E5%86%B3%E7%AD%96%E6%A0%91%E5%AE%9E%E6%88%98%E9%9A%90%E5%BD%A2%E7%9C%BC%E9%95%9C%E5%88%86%E7%B1%BB/"
           data-tag="机器学习"
           data-author="" >
            <span class="post-title" title="决策树实战隐形眼镜分类">决策树实战隐形眼镜分类</span>
            <span class="post-date" title="2020-04-14 10:49:40">2020/04/14</span>
        </a>
        
        <a  class="机器学习实战 "
           href="/2020/04/12/KNN%E5%AE%9E%E6%88%98%E4%B9%8B%E6%B5%B7%E4%BC%A6%E7%BA%A6%E4%BC%9A/"
           data-tag="机器学习"
           data-author="" >
            <span class="post-title" title="KNN实战之海伦约会">KNN实战之海伦约会</span>
            <span class="post-date" title="2020-04-12 08:22:12">2020/04/12</span>
        </a>
        
        <a  class="博客搭建 "
           href="/2020/04/08/hexo-%E4%B8%BB%E9%A2%98%E6%B7%BB%E5%8A%A0%E8%AF%84%E8%AE%BA/"
           data-tag="博客搭建"
           data-author="" >
            <span class="post-title" title="hexo 主题添加评论">hexo 主题添加评论</span>
            <span class="post-date" title="2020-04-08 21:43:26">2020/04/08</span>
        </a>
        
        <a  class="项目实战 "
           href="/2020/03/30/%E6%98%8E%E5%A4%A9%E4%BC%9A%E4%B8%8B%E9%9B%A8%E5%90%97%EF%BC%9F/"
           data-tag="机器学习"
           data-author="" >
            <span class="post-title" title="明天会下雨吗？">明天会下雨吗？</span>
            <span class="post-date" title="2020-03-30 11:25:31">2020/03/30</span>
        </a>
        
        <a  class="项目实战 "
           href="/2020/03/23/%E5%86%B3%E7%AD%96%E6%A0%91%E5%AE%9E%E7%8E%B0Titanic-%E9%87%8D%E8%A6%81/"
           data-tag="机器学习"
           data-author="" >
            <span class="post-title" title="决策树实现Titanic(重要)">决策树实现Titanic(重要)</span>
            <span class="post-date" title="2020-03-23 17:09:05">2020/03/23</span>
        </a>
        
        <a  class="项目实战 "
           href="/2020/03/21/Titanic-%E9%A1%B9%E7%9B%AE%E8%AF%A6%E8%A7%A3/"
           data-tag="机器学习"
           data-author="" >
            <span class="post-title" title="Titanic 项目详解">Titanic 项目详解</span>
            <span class="post-date" title="2020-03-21 14:07:20">2020/03/21</span>
        </a>
        
        <a  class="项目实战 "
           href="/2020/03/19/kaggle%E9%A1%B9%E7%9B%AE%E5%AE%9E%E6%88%98/"
           data-tag="机器学习"
           data-author="" >
            <span class="post-title" title="kaggle项目实战，Titanic analysis">kaggle项目实战，Titanic analysis</span>
            <span class="post-date" title="2020-03-19 10:08:13">2020/03/19</span>
        </a>
        
        <a  class=""
           href="/2020/03/17/Pytorch-%E6%90%AD%E5%BB%BA%E7%A5%9E%E7%BB%8F%E7%BD%91%E7%BB%9C/"
           data-tag=""
           data-author="" >
            <span class="post-title" title="Pytorch 搭建神经网络">Pytorch 搭建神经网络</span>
            <span class="post-date" title="2020-03-17 14:56:16">2020/03/17</span>
        </a>
        
        <a  class=""
           href="/2020/03/16/CNN%E5%8E%9F%E7%90%86/"
           data-tag="机器学习"
           data-author="" >
            <span class="post-title" title="CNN">CNN</span>
            <span class="post-date" title="2020-03-16 09:11:00">2020/03/16</span>
        </a>
        
        <a  class=""
           href="/2020/03/14/%E9%9A%8F%E6%9C%BA%E6%A3%AE%E6%9E%97%E5%92%8Ck%E5%9D%87%E5%80%BC/"
           data-tag="机器学习"
           data-author="" >
            <span class="post-title" title="random forest and k means">random forest and k means</span>
            <span class="post-date" title="2020-03-14 16:29:22">2020/03/14</span>
        </a>
        
        <a  class=""
           href="/2020/03/13/%E6%94%AF%E6%8C%81%E5%90%91%E9%87%8F%E6%9C%BA%E7%AE%97%E6%B3%95/"
           data-tag="机器学习"
           data-author="" >
            <span class="post-title" title="支持向量机">支持向量机</span>
            <span class="post-date" title="2020-03-13 20:53:20">2020/03/13</span>
        </a>
        
        <a  class=""
           href="/2020/03/11/Matplotlab/"
           data-tag="机器学习"
           data-author="" >
            <span class="post-title" title="Matplotlab">Matplotlab</span>
            <span class="post-date" title="2020-03-11 10:13:20">2020/03/11</span>
        </a>
        
        <a  class=""
           href="/2020/03/10/pandas/"
           data-tag="机器学习"
           data-author="" >
            <span class="post-title" title="pandas">pandas</span>
            <span class="post-date" title="2020-03-10 09:20:27">2020/03/10</span>
        </a>
        
        <a  class=""
           href="/2020/03/09/logical-regression/"
           data-tag="机器学习"
           data-author="" >
            <span class="post-title" title="logical regression">logical regression</span>
            <span class="post-date" title="2020-03-09 20:30:33">2020/03/09</span>
        </a>
        
        <a  class="学习网站推荐 "
           href="/2020/03/08/%E5%AD%A6%E4%B9%A0%E7%BD%91%E7%AB%99%E6%88%96%E5%B7%A5%E5%85%B7%E6%8E%A8%E8%8D%90/"
           data-tag="网站推荐"
           data-author="" >
            <span class="post-title" title="学习网站或工具推荐">学习网站或工具推荐</span>
            <span class="post-date" title="2020-03-08 20:44:55">2020/03/08</span>
        </a>
        
        <a  class="机器学习 "
           href="/2020/03/08/%E8%B4%9D%E5%8F%B6%E6%96%AF%E5%88%86%E6%9E%90/"
           data-tag="机器学习"
           data-author="" >
            <span class="post-title" title="贝叶斯分析">贝叶斯分析</span>
            <span class="post-date" title="2020-03-08 20:11:15">2020/03/08</span>
        </a>
        
        <a  class="机器学习 "
           href="/2020/03/08/numpy/"
           data-tag="机器学习"
           data-author="" >
            <span class="post-title" title="numpy的使用">numpy的使用</span>
            <span class="post-date" title="2020-03-08 19:15:54">2020/03/08</span>
        </a>
        
        <a  class="机器学习 "
           href="/2020/03/07/%E5%86%B3%E7%AD%96%E6%A0%91/"
           data-tag="机器学习"
           data-author="" >
            <span class="post-title" title="决策树">决策树</span>
            <span class="post-date" title="2020-03-07 19:27:38">2020/03/07</span>
        </a>
        
        <a  class="机器学习 "
           href="/2020/03/06/K-%E8%BF%91%E9%82%BB%E7%AE%97%E6%B3%95/"
           data-tag="算法"
           data-author="" >
            <span class="post-title" title="K-近邻算法">K-近邻算法</span>
            <span class="post-date" title="2020-03-06 20:18:19">2020/03/06</span>
        </a>
        
        <a  class="算法 "
           href="/2020/03/05/%E6%8E%92%E5%BA%8F%E7%AE%97%E6%B3%95/"
           data-tag="算法"
           data-author="" >
            <span class="post-title" title="排序算法">排序算法</span>
            <span class="post-date" title="2020-03-05 19:41:32">2020/03/05</span>
        </a>
        
        <a  class="算法 "
           href="/2020/03/04/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E4%B8%8E%E6%97%B6%E9%97%B4%E5%A4%8D%E6%9D%82%E5%BA%A6/"
           data-tag="算法"
           data-author="" >
            <span class="post-title" title="数据结构与时间复杂度">数据结构与时间复杂度</span>
            <span class="post-date" title="2020-03-04 21:00:32">2020/03/04</span>
        </a>
        
        <a  class="机器学习 "
           href="/2020/03/04/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0%E6%95%B0%E5%AD%A6%E5%9F%BA%E7%A1%80/"
           data-tag="机器学习"
           data-author="" >
            <span class="post-title" title="机器学习数学基础">机器学习数学基础</span>
            <span class="post-date" title="2020-03-04 16:48:34">2020/03/04</span>
        </a>
        
        <a  class="算法 "
           href="/2020/03/03/leetcode%E7%AE%97%E6%B3%95%E7%BB%83%E4%B9%A0/"
           data-tag="算法"
           data-author="" >
            <span class="post-title" title="哈希图 and 移动窗口">哈希图 and 移动窗口</span>
            <span class="post-date" title="2020-03-03 18:49:52">2020/03/03</span>
        </a>
        
        <a  class="机器学习 "
           href="/2020/03/01/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0%E5%9F%BA%E6%9C%AC%E6%9C%AF%E8%AF%AD/"
           data-tag="机器学习"
           data-author="" >
            <span class="post-title" title="1 零基础学机器学习">1 零基础学机器学习</span>
            <span class="post-date" title="2020-03-01 20:23:40">2020/03/01</span>
        </a>
        
        <a  class="博客搭建 "
           href="/2020/02/20/Windows%E7%B3%BB%E7%BB%9F%E4%B8%8B%E7%94%A8hexo%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/"
           data-tag="博客搭建"
           data-author="" >
            <span class="post-title" title="Windows系统下用hexo搭建个人博客">Windows系统下用hexo搭建个人博客</span>
            <span class="post-date" title="2020-02-20 13:15:25">2020/02/20</span>
        </a>
        
    </nav>
</div>
    </div>
    <div class="hide-list">
        <div class="semicircle">
            <div class="brackets first"><</div>
            <div class="brackets">&gt;</div>
        </div>
    </div>
</aside>
<div class="post">
    <div class="pjax">
        <article id="post-Windows系统下用hexo搭建个人博客" class="article article-type-post" itemscope itemprop="blogPost">
    
        <h1 class="article-title">Windows系统下用hexo搭建个人博客</h1>
    
    <div class="article-meta">
        
        
        
        <span class="book">
            
                <a  data-rel="博客搭建">博客搭建</a>
            
        </span>
        
        
        <span class="tag">
            
            <a class="color5">博客搭建</a>
            
        </span>
        
    </div>
    <div class="article-meta">
        
        创建时间:<time class="date" title='更新时间: 2020-02-22 09:54:23'>2020-02-20 13:15</time>
        
    </div>
    <div class="article-meta">
        
        <span>字数:1.6k</span>
        
        
        <span id="busuanzi_container_page_pv">
            阅读:<span id="busuanzi_value_page_pv">
                <span class="count-comment">
                    <span class="spinner">
                      <div class="cube1"></div>
                      <div class="cube2"></div>
                    </span>
                </span>
            </span>
        </span>
        
        
        <span class="top-comment" title="跳转至评论区">
            <a href="#comments">
                评论:<span class="count-comment">
                    <span class="spinner">
                      <div class="cube1"></div>
                      <div class="cube2"></div>
                    </span>
                </span>
            </a>
        </span>
        
    </div>
    
    <div class="toc-ref">
    
        <ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#windows利用hexo搭建自己的博客"><span class="toc-text"> windows利用hexo搭建自己的博客</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#采用hexo搭建个人博客"><span class="toc-text"> 采用hexo搭建个人博客</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#安装步骤"><span class="toc-text"> 安装步骤</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#启动你的blog"><span class="toc-text"> 启动你的blog</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#写你的第一篇博客"><span class="toc-text"> 写你的第一篇博客</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#让别人也能访问你的博客"><span class="toc-text"> 让别人也能访问你的博客</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#如何自定义主题"><span class="toc-text"> 如何自定义主题</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#点击访问我的博客"><span class="toc-text"> 点击访问我的博客</span></a></li></ol></li></ol>
    
<style>
    .left-col .switch-btn,
    .left-col .switch-area {
        display: none;
    }
    .toc-level-3 i,
    .toc-level-3 ol {
        display: none !important;
    }
</style>
</div>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h1 id="windows利用hexo搭建自己的博客"><a class="markdownIt-Anchor" href="#windows利用hexo搭建自己的博客"></a> windows利用hexo搭建自己的博客</h1>
<h2 id="采用hexo搭建个人博客"><a class="markdownIt-Anchor" href="#采用hexo搭建个人博客"></a> 采用hexo搭建个人博客</h2>
<h3 id="安装步骤"><a class="markdownIt-Anchor" href="#安装步骤"></a> 安装步骤</h3>
<ol>
<li>百度搜索nodejs网站，下载nodejs软件到电脑上</li>
</ol>
<hr />
<ol start="2">
<li>打开cmd，输入<code>npm install -g cnpm --registry-https://registry.npm.taobao.org</code></li>
<li>接着输入<code>cnpm</code>命令，系统会自动补全命令，输入<code>cnpm -v</code>可以查看安装的版本号。如果有输入，则安装成功</li>
<li>输入<code>cnpm install -g hexo-cli</code>命令，安装hexo</li>
<li>输入<code>mkdir blog</code>接下来会在当前目录下创建一个blog文件夹，自己可以去该目录下查看是否生成，输入<code>chdir</code>可以查看目录，会自己显示出来</li>
<li>此时我们继续在cmd下输入<code>hexo init</code>，会提示报错，所以我们这时候应该打开浏览器，百度搜索git，找到git的官网，下载软件到电脑上，<font color='red'>注意记得安装路径，不要随便添加</font></li>
</ol>
<hr />
<ol start="7">
<li>
<p>下载好git后，我们可以在git的安装路径下发现几个文件 <img src="http://i2.tiimg.com/710246/7b6b9af5b5aa3ce0.png" alt="Markdown" /></p>
<hr />
</li>
<li>
<p>接下来要添加git到环境变量，首先复制该路径，找到我的电脑，标右键点属性，再点击高级系统设置，可以看到环境变量，找到path点击编辑，将文件路径复制进去即可</p>
</li>
</ol>
<p><img src="http://i2.tiimg.com/710246/bac6d69fed6aa81f.png" alt="Markdown" /><br />
<img src="http://i2.tiimg.com/710246/c948c3ef2ce69d10.png" alt="Markdown" /><br />
<img src="http://i2.tiimg.com/710246/0e14c66f125c744b.png" alt="Markdown" /><br />
<img src="http://i2.tiimg.com/710246/ffd5097a0096077a.png" alt="Markdown" /></p>
<ol start="9">
<li>
<p>返回git软件安装目录下，打开git-bash软件，打开后可以看到一个类似于cmd窗口的交互界面，<font color='red'>剩下的步骤我们将会在git-bash运行</font></p>
</li>
<li>
<p>按步骤在git-bash里面输入下列代码,最开始我新建的blog文件目录是C:\Users\asus\blog，具体情况看个人安装目录</p>
<ol>
<li><code>cd C:</code></li>
<li><code>cd Users</code></li>
<li><code>cd asus</code></li>
<li><code>cd blog</code></li>
</ol>
</li>
<li>
<p>进到该目录下后，输入<code>hexo init</code>然后就会自动初始化hexo，这里需要等待一段时间，等待完后，我们找到blog目录并打开，会发现里面出现了许多文件，后面制作博客会用到, <font color='red'>不要关闭你的git-bash等下还要用到</font></p>
</li>
</ol>
<hr />
<h2 id="启动你的blog"><a class="markdownIt-Anchor" href="#启动你的blog"></a> 启动你的blog</h2>
<ol>
<li>在git-bash中输入<code>hexo s</code>，然后可以发现你的博客端口</li>
</ol>
<pre class="highlight"><code class="">$ hexo s
INFO  Start processing
INFO  Hexo is running at http://localhost:4000 . Press Ctrl+C to stop.

</code></pre>
<ol start="2">
<li>打开浏览器，输入<code>localhost:4000</code>就可以看到你的博客啦<font color='red'>注意不要关闭git-bash</font></li>
<li>按 Ctrl+C 进行下一步操作</li>
</ol>
<hr />
<h2 id="写你的第一篇博客"><a class="markdownIt-Anchor" href="#写你的第一篇博客"></a> 写你的第一篇博客</h2>
<ol>
<li>在git-bash里面接着输入<code>hexo n &quot;我的第一篇博客&quot;</code>,然后他会自己创建一个markdown文件</li>
</ol>
<pre class="highlight"><code class="">$ hexo n &quot;我的第一篇博客&quot;
INFO  Created: ~\blog\source\_posts\我的第一篇博客.md

</code></pre>
<p>创建的位置是blog下的source文件夹里的_posts</p>
<ol start="2">
<li>
<p>输入<code>cd source/_posts/</code>进入到该文件夹内，输入<code>dir</code>查看该文件夹里面有什么，结果发现确实生成了一个md文件，建议用Typora软件来编辑markdown文件</p>
</li>
<li>
<p>输入命令<code>cd ../..</code>退回到blog目录下</p>
</li>
<li>
<p>输入<code>hexo clearn</code>清除下数据库 和 <code>hexo g</code>就会为你生成博客，接着我们输入<code>hexo s</code>就可以打开博客了，可以看到里面有你的第一篇博客，博客我们直接在刚才的source里面编辑就可以了，刷新页面，网页里面的博客内容也会刷新</p>
<p><font color='red'>虽然你的博客生成了，但此时别人还是访问不了</font></p>
<hr />
<h2 id="让别人也能访问你的博客"><a class="markdownIt-Anchor" href="#让别人也能访问你的博客"></a> 让别人也能访问你的博客</h2>
<p>由于刚才这样写的博客我们只能给自己看，所以我们要把自己的博客部署到网站上去，这里使用的免费方法是github，百度搜索github，登录后新建一个仓库，名字默认是下面的格式<br />
<img src="http://i2.tiimg.com/710246/bc0b422db61b7e4b.png" alt="Markdown" /><br />
<img src="http://i2.tiimg.com/710246/eff483274ea75be0.png" alt="Markdown" /><br />
创建好了后，返回git-bash中，切换到blog目录下，这时我们要在blog目录下安装一个hexo插件，直接输入命令<code>cnpm install --save hexo-deployer-git</code></p>
</li>
</ol>
<pre class="highlight"><code class="">_config.yml  node_modules  package-lock.json  scaffolds  themes
db.json      package.json  public             source

</code></pre>
<p>我们可以发现生成了一个_config.yml 文件，接着输入<code>notepad _config.yml</code>,电脑会用记事本打开这个文件，在文件最下面，我们可以看到一个#Deployment<br />
<img src="http://i2.tiimg.com/710246/3be705fa79e51eb9.png" alt="Markdown" /></p>
<p>将下面地址复制进记事本中，修改记事本中的一部分内容，按图片来操作</p>
<p><font color='red'><strong>注意每个冒号后要加一个空格</strong></font></p>
<p><img src="http://i2.tiimg.com/710246/90540aa9326a4891.png" alt="Markdown" /><br />
修改好后保存退出</p>
<ol start="5">
<li>设置git-bash的身份<br />
<code>git config --global user.name &quot;xxx&quot;</code><br />
<code>git config --global user.email &quot;xxx&quot;</code><br />
注意空格，或者你直接复制把xxx改成你自己的信息，名字随便取，邮箱可以是qq邮箱<br />
然后输入<code>git config user.name</code>and<code>git config user.email</code>查看是否真的生成了信息</li>
<li>设置好gitbash的身份之后，接着输入<code>hexo d</code>，然后就会要你登录 github<br />
例如我自己gitgub账号邮箱是747876457@qq.com, gitbash设置的是mcspero123@gmail.com<br />
然后再用密码登录即可<br />
7.登录成功后gitbash窗口就在下载东西，等待即可，下载成功后，刷新你的github仓库，会发现生成了很多新的文件</li>
</ol>
<blockquote>
<p>期间我输入<code>hexo d</code>然后报错了很多次，但是没关系，我们一直输入hexo d命令直到成功即可</p>
</blockquote>
<ol start="7">
<li>然后拿仓库名后面的部分，直接复制到浏览器中即可访问你的博客了<br />
<img src="http://i2.tiimg.com/710246/ca58a5c317e1f955.png" alt="Markdown" /></li>
</ol>
<blockquote>
<p>例如我的博客地址就是https://miki123-gif.github.io/</p>
</blockquote>
<hr />
<h2 id="如何自定义主题"><a class="markdownIt-Anchor" href="#如何自定义主题"></a> 如何自定义主题</h2>
<ol>
<li>下载别人的主题<br />
这里下载会出现一些问题，是因为主题太大了，gitbash做了下载设置<a href="https://blog.csdn.net/dzhongjie/article/details/81152983" target="_blank" rel="noopener">可以看看这篇文章</a><br />
直接先输入<code>git config --global http.postBuffer 524288000</code>就行啦<br />
在git-bash窗口中，注意切换到你之前创建的blog文件夹下，输入<br />
<code>git clone https://github.com/litten/hexo-theme-yilia.git themes/yilia</code><br />
<a href="https://github.com/litten/hexo-theme-yilia.git%E5%85%B6%E5%AE%9E%E6%98%AF%E4%B8%80%E4%B8%AA%E5%88%AB%E4%BA%BA%E7%9A%84%E4%BB%93%E5%BA%93%E5%90%8D%E7%A7%B0%EF%BC%8C%E6%88%91%E4%BB%AC%E8%BF%99%E9%87%8C%E7%94%A8%E7%9A%84%E6%98%AF%E5%88%AB%E4%BA%BA%E5%86%99%E7%9A%84%E5%8D%9A%E5%AE%A2%E4%B8%BB%E9%A2%98,%E6%8A%8A%E5%AE%83%E5%A4%8D%E5%88%B6%E5%88%B0themes%E7%9B%AE%E5%BD%95%E4%B8%8B%E7%9A%84yilia%E6%96%87%E4%BB%B6%E5%A4%B9%E5%86%85%EF%BC%8C%E8%A6%81%E7%AD%89%E5%BE%85%E4%B8%80%E6%AE%B5%E6%97%B6%E9%97%B4" target="_blank" rel="noopener">https://github.com/litten/hexo-theme-yilia.git其实是一个别人的仓库名称，我们这里用的是别人写的博客主题,把它复制到themes目录下的yilia文件夹内，要等待一段时间</a></li>
</ol>
<p>下载完后，退回到blog目录下，再次找到_config.yml文件，修改里面的theme成yilia<br />
<img src="http://i2.tiimg.com/710246/be42d7bcf66ebd2c.png" alt="Markdown" /></p>
<p>然后依次输入指令<code>hexo clean</code> <code>hexo g</code> <code>hexo s</code></p>
<p>就可以在localhost:4000上看到自己的博客变了一个主题</p>
<ol start="2">
<li>
<p>将主题推到云端，这样别人就可以访问</p>
<p>退回到blog目录下，输入<code>hexo d</code>deploy一下，别人就可以看到你的主题了</p>
</li>
</ol>
<h2 id="点击访问我的博客"><a class="markdownIt-Anchor" href="#点击访问我的博客"></a> <a href="https://miki123-gif.github.io/" target="_blank" rel="noopener">点击访问我的博客</a></h2>

      
       
    </div>
</article>



<div class="article_copyright">
    <p><span class="copy-title">文章标题:</span>Windows系统下用hexo搭建个人博客</p>
    <p><span class="copy-title">文章字数:</span><span class="post-count">1.6k</span></p>
    <p><span class="copy-title">本文作者:</span><a  title="Miki Zhu">Miki Zhu</a></p>
    <p><span class="copy-title">发布时间:</span>2020-02-20, 13:15:25</p>
    <p><span class="copy-title">最后更新:</span>2020-02-22, 09:54:23</p>
    <span class="copy-title">原始链接:</span><a class="post-url" href="/2020/02/20/Windows%E7%B3%BB%E7%BB%9F%E4%B8%8B%E7%94%A8hexo%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/" title="Windows系统下用hexo搭建个人博客">http://mikiblog.online/2020/02/20/Windows%E7%B3%BB%E7%BB%9F%E4%B8%8B%E7%94%A8hexo%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/</a>
    <p>
        <span class="copy-title">版权声明:</span><i class="fa fa-creative-commons"></i> <a rel="license noopener" href="http://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank" title="CC BY-NC-SA 4.0 International" target = "_blank">"署名-非商用-相同方式共享 4.0"</a> 转载请保留原文链接及作者。
    </p>
</div>



    <div id="vcomment" class="comment"></div> 
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src='//unpkg.com/valine/dist/Valine.min.js'></script>
<script src="https://cdnjs.loli.net/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
    var notify = 'false' == true ? true : false;
    var verify = 'false' == true ? true : false;
    new Valine({
        av: AV,
        el: '#vcomment',
        notify: notify,
        app_id: "3uM9nFQKJdCUOHqwT3LHL5Mt-gzGzoHsz",
        app_key: "3v4CdFJJjh97olrmyHxtdDlt",
        placeholder: "请输入",
        avatar:"mm",
    });
</script>



    





  <section id="comments" class="vcomment">
  </section>

    </div>
    <div class="copyright">
        <p class="footer-entry">©2016-2019 MikiZhu 赣ICP备20004640号</p>
<p class="footer-entry">Built with <a href="https://hexo.io/" target="_blank">Hexo</a> and <a href="https://github.com/yelog/hexo-theme-3-hexo" target="_blank">3-hexo</a> theme</p>

    </div>
    <div class="full-toc">
        <button class="full"><span class="min "></span></button>
<button class="post-toc-menu"><span class="post-toc-menu-icons"></span></button>
<div class="post-toc"><span class="post-toc-title">目录</span>
    <div class="post-toc-content">

    </div>
</div>
<a class="" id="rocket" ></a>

    </div>
</div>
<div class="acParent"></div>

</body>
<script src="/js/jquery.pjax.js?v=1.0.1" ></script>

<script src="/js/script.js?v=1.0.1" ></script>
<script>
    var img_resize = 'default';
    /*作者、标签的自动补全*/
    $(function () {
        $('.search').AutoComplete({
            'data': ['#机器学习','#算法','#博客搭建','#python','#网站推荐','#考研经验',],
            'itemHeight': 20,
            'width': 418
        }).AutoComplete('show');
    })
    function initArticle() {
        /*渲染对应的表格样式*/
        
            $(".post .pjax table").addClass("green_title");
        

        /*渲染打赏样式*/
        

        /*高亮代码块行号*/
        

        /*访问数量*/
        
        $.getScript("//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js");
        

        /*代码高亮，行号对齐*/
        $('.pre-numbering').css('line-height',$('.has-numbering').css('line-height'));

        
        
    }

    /*打赏页面隐藏与展示*/
    

</script>

<!--加入行号的高亮代码块样式-->

<!--自定义样式设置-->
<style>
    
    
    .nav {
        width: 542px;
    }
    .nav.fullscreen {
        margin-left: -542px;
    }
    .nav-left {
        width: 120px;
    }
    
    
    @media screen and (max-width: 1468px) {
        .nav {
            width: 492px;
        }
        .nav.fullscreen {
            margin-left: -492px;
        }
        .nav-left {
            width: 100px;
        }
    }
    
    
    @media screen and (max-width: 1024px) {
        .nav {
            width: 492px;
            margin-left: -492px
        }
        .nav.fullscreen {
            margin-left: 0;
        }
        .nav .hide-list.fullscreen {
            left: 492px
        }
    }
    
    @media screen and (max-width: 426px) {
        .nav {
            width: 100%;
        }
        .nav-left {
            width: 100%;
        }
    }
    
    
    .nav-right .title-list nav a .post-title, .nav-right .title-list #local-search-result a .post-title {
        color: #383636;
    }
    
    
    .nav-right .title-list nav a .post-date, .nav-right .title-list #local-search-result a .post-date {
        color: #5e5e5f;
    }
    
    
    .nav-right nav a.hover, #local-search-result a.hover{
        background-color: #e2e0e0;
    }
    
    

    /*列表样式*/
    
    .post .pjax article .article-entry>ol, .post .pjax article .article-entry>ul, .post .pjax article>ol, .post .pjax article>ul{
        border: #e2dede solid 1px;
        border-radius: 10px;
        padding: 10px 32px 10px 56px;
    }
    .post .pjax article .article-entry li>ol, .post .pjax article .article-entry li>ul,.post .pjax article li>ol, .post .pjax article li>ul{
        padding-top: 5px;
        padding-bottom: 5px;
    }
    .post .pjax article .article-entry>ol>li, .post .pjax article .article-entry>ul>li,.post .pjax article>ol>li, .post .pjax article>ul>li{
        margin-bottom: auto;
        margin-left: auto;
    }
    .post .pjax article .article-entry li>ol>li, .post .pjax article .article-entry li>ul>li,.post .pjax article li>ol>li, .post .pjax article li>ul>li{
        margin-bottom: auto;
        margin-left: auto;
    }
    

    /* 背景图样式 */
    
    


    /*引用块样式*/
    

    /*文章列表背景图*/
    
    .nav-right:before {
        content: ' ';
        display: block;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        opacity: 0.4;
        background: url("http://q8idlsxje.bkt.clouddn.com/%E6%B5%B7%E6%BB%A9.jpg");
        background-repeat: no-repeat;
        background-position: 50% 0;
        -ms-background-size: cover;
        -o-background-size: cover;
        -moz-background-size: cover;
        -webkit-background-size: cover;
        background-size: cover;
    }
    

    
</style>







  <script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
  <script src="//unpkg.com/valine/dist/Valine.min.js"></script>
  <script>
    var GUEST_INFO = ['nick','mail','link'];
    var guest_info = 'nick,mail,link'.split(',').filter(function(item){
        return GUEST_INFO.indexOf(item) > -1
    });
    var notify = 'false' == true;
    var verify = 'false' == true;
    new Valine({
      el: '.vcomment',
      notify: notify,
      verify: verify,
      appId: "3uM9nFQKJdCUOHqwT3LHL5Mt-gzGzoHsz",
      appKey: "3v4CdFJJjh97olrmyHxtdDlt",
      placeholder: "请输入",
      pageSize: '10',
      avatar: 'mm',
      lang: 'zh-cn',
      visitor: 'true'
    });
  </script>

</html>
